#include "grider.h"

bool grider::Vertical = true;
bool grider::Horizontal = false;

void grider::addSeparator(int x_or_y, bool isVertical, int weight, Color col)
{
   if(isVertical)
      line.push_back(Shape::Line(x_or_y, 0, x_or_y, maxHeight, weight, col));
   else
      line.push_back(Shape::Line(0, x_or_y, maxWidth, x_or_y, weight, col));
}

void grider::genGrid(pix_coord p_left_top, int width, int height, int weight, Color col)
{
   int x_start = p_left_top.x;
   int y_start = p_left_top.y;
   
   left_top = p_left_top;
   
   for(int i = 0 ; i <= width ; i++)
      line.push_back(Shape::Line(x_start+(TILE_DIM)*i,y_start,x_start+(TILE_DIM)*i,y_start+(TILE_DIM)*height,weight,col));
   for(int i = 0 ; i <= height ; i++)
      line.push_back(Shape::Line(x_start,y_start+(TILE_DIM)*i,x_start+(TILE_DIM)*width,y_start+(TILE_DIM)*i,weight,col));
}

void grider::draw()
{
   for(int i = 0 ; i < line.size() ; i++)
      App->Draw(line[i]);
}
